package com.ieei.serviceImpl;

import org.springframework.beans.factory.annotation.Autowired;

import com.ieei.mapper.IBaseOperation;
import com.ieei.service.BaseService;

/**
 *
 * @param <T>
 *            BaseServiceImpl
 */
public abstract class BaseServiceImpl<T> implements BaseService<T> {
	@Autowired
	IBaseOperation<T> iBaseOperation;

	/**
	 * 
	 * @param id
	 * @return T
	 */
	@Override
	public T find(Long id) {

		return iBaseOperation.find(id);
	}

	/**
	 * 
	 * @param entity
	 */
	@Override
	public void save(T entity) {
		iBaseOperation.save(entity);
	}

	/**
	 * 
	 * @param entity
	 */
	@Override
	public void update(T entity) {
		iBaseOperation.update(entity);
	}

	/**
	 * 
	 * @param entity
	 */
	@Override
	public void delete(T entity) {
		iBaseOperation.delete(entity);
	}

	/**
	 * 
	 * @param id
	 */
	@Override
	public void deleteById(Long id) {
		iBaseOperation.deleteById(id);
	}

}
